<?php

namespace app\index\model;

use think\Model;
use traits\model\SoftDelete;

class Banner extends BaseModel
{
    use SoftDelete;
    protected $deleteTime = "deletetime";


    public static function getBanners($type)
    {
        return self::where('onlineswitch', 1)->where('typedata', $type)->order('weigh desc')->select();
    }

    public static function getBanner($type)
    {
        return self::where('onlineswitch', 1)->where('typedata', $type)->order('weigh desc')->value('image');
    }
}
